package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created by venus on 20/09/14.
 */
public class User {

    public ArrayList<ILibraryItem> userBorrowedItems;
    private String libraryNumber;
    private String name;
    private String email;
    private String phoneNumber;
    private String username;
    private String password;

    public User( String libraryNumber, String password) {
        this.libraryNumber = libraryNumber;
        this.password = password;
        userBorrowedItems = new ArrayList<ILibraryItem>();
    }

    public String getLibraryNumber() {
        return this.libraryNumber;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return this.password;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String provideUserDetails(){

        String userInfo =  "Library ID: " + this.getLibraryNumber() + " | Name: " + this.getName() + " | Email: " + this.getEmail() + " | Username: "+ this.getUsername();
        String borrowedItems="";

        for (ILibraryItem item: this.userBorrowedItems)
             borrowedItems += item.getName() + ", ";

        String userDetails = userInfo + "\n" + "And my borrowed items are: " + borrowedItems ;

        return userDetails;
    }
}
